﻿using Catchbase.TestTools.UTest;
using WatiN.Core;

namespace Catchbase.Web.ATest.Pages.Shared
{
    public abstract class Layout
    {
        private readonly SecretSettings _config;

        protected Layout(SecretSettings config, Browser browser, LogOnPartial logOnPartial)
        {
            _config = config;
            LogOnPartial = logOnPartial;
            Browser = browser;
        }

        public LogOnPartial LogOnPartial { get; private set; }
        protected Browser Browser { get; private set; }
        protected string BaseUrl
        {
            get { return _config.UrlHome; }
        }

        public void Load()
        {
            Browser.GoTo(AbsolutePath);
        }

        public abstract string Path { get; }
        public string AbsolutePath
        {
            get { return BaseUrl + Path; }
        }
    }
}